#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
void maopao(int arr[], int sz)
{
	int a, b, c, d;
	for (a = 0; a < sz-1; a++)
	{
		c = 0;
		for (b = 0; b < sz-1-a; b++)
		{
			if (*(arr + b) > *(arr + b + 1))
			{
				d = *(arr + b);
				*(arr + b) = *(arr + b + 1);
				*(arr + b + 1) = d;
				c = 1;
			}
		}
		if (c == 0)
		{
			break;
		}
	}
}
void print(int arr[], int sz)
{
	int a;
	for (a = 0; a < sz; a++)
	{
		printf("%d", *(arr + a));
	}
	printf("\n");
}
int main()
{
	int arr[10] = { 9,8,7,6,5,4,3,2,1,0 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	print(arr, sz);
	maopao(arr, sz);
	print(arr, sz);
	return 0;
}
